package joboo4;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class job01 {
    public static void main(String[] args) {
        String str = "我爱Java!";
        String a="   我爱java   ";
        //length
        int len = str.length();
        System.out.println(len);

        //trim
        a =a.trim();
        System.out.println(a);

        //ToUpperCase;ToLowerCase
        System.out.println(str.toUpperCase());
        System.out.println(str.toLowerCase());


        //StartsWith;EndsWith
        boolean start=str.startsWith("我");
        System.out.println(start);
        boolean end=str.endsWith("爱");
        System.out.println(end);



        //CharAt
        char c=str.charAt(5);
        System.out.println(c);

        //IndexOf;LastIndexOf
        int index=str.indexOf("a");
        System.out.println(index);
        index=str.indexOf("a",4);
        System.out.println(index);
        index=str.lastIndexOf("v");
        System.out.println(index);

        //SubString
        String sub=str.substring(2,6);
        System.out.println(sub);
        int A=str.indexOf("J");
        int B=str.lastIndexOf("!");
        String Sub=str.substring(A,B);
        System.out.println(Sub);

        //ValueOf
        int aa=123;
        String s1=String.valueOf(aa);
        System.out.println(s1);

        double bb=123.456;
        String s2=String.valueOf(bb);
        System.out.println(s2);



    }
}
